<script setup lang="ts">
import {ref} from "vue";
import ReCol from "@/components/ReCol";

import {SmainFormProps} from "./ts/types";

const props = withDefaults(defineProps<SmainFormProps>(), {
  formInline: () => ({
    id: undefined,
    name: undefined,
    createBy: undefined,
    createTime: undefined,
    updateBy: undefined,
    updateTime: undefined,
  })
});

const ruleFormRefSmain = ref();
const newFormInlineSmain = ref(props.formInline);

function getRefSmain() {
  return ruleFormRefSmain.value;
}

defineExpose({getRefSmain});
</script>

<template>
  <el-form
      ref="ruleFormRefSmain"
      :model="newFormInlineSmain"
      :rules="ruleFormRefSmain"
      label-width="82px"
  >
    <el-row :gutter="30">
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="" prop="id">
          <el-input
              v-model="newFormInlineSmain.id"
              clearable
              placeholder="请输入"
          />
        </el-form-item>
      </re-col>
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="名字" prop="name">
          <el-input
              v-model="newFormInlineSmain.name"
              clearable
              placeholder="请输入名字"
          />
        </el-form-item>
      </re-col>
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="创建人" prop="createBy">
          <el-input
              v-model="newFormInlineSmain.createBy"
              clearable
              placeholder="请输入创建人"
          />
        </el-form-item>
      </re-col>
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="创建时间" prop="createTime">
          <el-input
              v-model="newFormInlineSmain.createTime"
              clearable
              placeholder="请输入创建时间"
          />
        </el-form-item>
      </re-col>
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="修改人" prop="updateBy">
          <el-input
              v-model="newFormInlineSmain.updateBy"
              clearable
              placeholder="请输入修改人"
          />
        </el-form-item>
      </re-col>
      <re-col :value="12" :xs="24" :sm="24">
        <el-form-item label="修改时间" prop="updateTime">
          <el-input
              v-model="newFormInlineSmain.updateTime"
              clearable
              placeholder="请输入修改时间"
          />
        </el-form-item>
      </re-col>
    </el-row>
  </el-form>
</template>
